package com.qzl.feiq.strategy.impl;

import com.qzl.feiq.annotation.ReceiveType;
import com.qzl.feiq.config.FeiQCache;
import com.qzl.feiq.enu.UserActionTypeEnum;
import com.qzl.feiq.message.Message;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import com.qzl.feiq.strategy.Receive;

/**
 * 扫描的在线用户
 */
@Slf4j
@ReceiveType(command = 6291459)
public class BrScanningReceiveImpl implements Receive {
    /**
     * 回复消息
     *
     * @param channel
     */
    @Override
    public void receiveMsg(Channel channel, Message oldMessage) {
//        log.info("扫描到在线用户{}",oldMessage);
        FeiQCache.onlineUsers.put(oldMessage.getFromUserIp(),oldMessage.getSenderHost());
        FeiQCache.userQueue.add(UserActionTypeEnum.login);
    }
}
